using NUnit.Framework;
using Rhino.Mocks;
using AmazonAttribute=Amazon.SimpleDB.Model.Attribute;

namespace Coditate.Savant.Core
{
    [TestFixture]
    public class DecoratingSavantTest
    {
        private class TestDecoratingSavant : DecoratingSavant
        {
            public TestDecoratingSavant(ISimpleSavant2Ex decoratedSavant)
                : base(decoratedSavant)
            {
            }
        }

        private ISimpleSavant2Ex decoratedSavant;
        private DecoratingSavant decoratingSavant;

        [SetUp]
        public void SetUp()
        {
            decoratedSavant = MockRepository.GenerateMock<ISimpleSavant2Ex>();
            decoratingSavant = new TestDecoratingSavant(decoratedSavant);
        }

        [TearDown]
        public void TearDown()
        {
            decoratedSavant.VerifyAllExpectations();
        }

        [Test]
        public void AllPassThrough()
        {
            decoratedSavant.Expect(d => d.DeleteAttributes(null, null));
            decoratedSavant.Expect(d => d.GetAttributes(null, null)).Return(null);
            decoratedSavant.Expect(d => d.PutAttributes(null));
            decoratedSavant.Expect(d => d.SelectAttributes(null)).Return(null);
            decoratedSavant.Expect(d => d.SelectScalar(null)).Return(null);

            decoratingSavant.DeleteAttributes(null, null);
            decoratingSavant.GetAttributes(null, null);
            decoratingSavant.PutAttributes(null);
            decoratingSavant.SelectAttributes(null);
            decoratingSavant.SelectScalar(null);
        }
    }
}